class condorworknode::install inherits condorworknode {
  case $facts['os']['release']['major'] {
  '7': {
    yumrepo { "condor":
      baseurl => "http://${mirrorserver}/yum/condor/9.0/el${facts['os']['release']['major']}/release",
      descr => "condor",
      enabled => 1,
      gpgcheck => 0,
      priority => 20,
      before   => Yumrepo['site'],
    }

    $condor_pkg = [
      "condor-9.0.4-1.el7.x86_64",
      "condor-classads-9.0.4-1.el7.x86_64",
      "condor-kbdd-9.0.4-1.el7.x86_64",
      "condor-procd-9.0.4-1.el7.x86_64",
      "condor-externals-9.0.4-1.el7.x86_64",
      "python2-condor-9.0.4-1.el7.x86_64",
    ]
  }
  '9': {
    yumrepo { "condor":
      baseurl => "http://${mirrorserver}/yum/condor/repo/10.x/el${facts['os']['release']['major']}/x86_64/release",
      descr => "condor",
      enabled => 1,
      gpgcheck => 0,
      priority => 20,
      before   => Yumrepo['site'],
    }

    $condor_pkg = [
      "condor",
      "condor-classads",
      "condor-kbdd",
      "condor-procd",
      "condor-externals",
      "python3-condor",
      "python3-scitokens",
    ]
  }
  }

  package { $condor_pkg:
              ensure  => installed,
              require => Yumrepo['site'],
  }
  if $workpkg {
  #lustre::pkgforce{"condor-worker-3.3-1.noarch":
  #  source           =>  "http://mirror.ihep.ac.cn/yum/site/7/x86_64/condor-worker-3.3-1.noarch.rpm",
  #}

    package { "condor-worker":
      ensure  => latest,
      require => Yumrepo['site'],
    }
  }
}
